package com.bacon.gmall.product.client;

import com.bacon.gmall.model.product.*;
import com.bacon.gmall.product.client.impl.ProductFeignClientImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author： bacon、
 * @version： 1.0
 * @create： 2020-12-23 19:19
 * @description:
 */
@FeignClient(name = "service-product", fallback = ProductFeignClientImpl.class)
public interface ProductFeignClient {

    @GetMapping("/api/product/inner/getBaseCategoryView/{category3Id}")
    BaseCategoryView getBaseCategoryView(@PathVariable Long category3Id);


    @GetMapping("/api/product/inner/getSkuInfo/{skuId}")
    SkuInfo getSkuInfo(@PathVariable Long skuId);


    @GetMapping("/api/product/getPrice/{skuId}")
    BigDecimal getPrice(@PathVariable Long skuId);


    @GetMapping("/api/product/inner/getSpuSaleAttrChecked/{spuId}/{skuId}")
    List<SpuSaleAttr> getSpuSaleAttrChecked(@PathVariable Long spuId,
                                            @PathVariable Long skuId);


    @GetMapping("/api/product/inner/getSaleAttrValuesBySpu/{spuId}")
    Map getSaleAttrValuesBySpu(@PathVariable Long spuId);


    @GetMapping("/api/product/inner/getBaseCategoryViewList")
    List<BaseCategoryView> getBaseCategoryViewList();


    @GetMapping("/api/product/inner/baseTrademark/{id}")
    BaseTrademark getBaseTrademark(@PathVariable Long id);


    @GetMapping("/api/product/inner/getBaseAttrInfoAndBaseAttrValue/{skuId}")
    public List<SkuAttrValue> getBaseAttrInfoAndBaseAttrValue(@PathVariable Long skuId);
}
